1. Field of the Invention
The present invention generally relates to performance tuning methods and apparatus, program and storage media, and more particularly to a performance tuning method and a performance tuning apparatus for tuning the performance of a target program that is the measuring target using different running performance measuring methods, a computer-readable program for causing a computer to carry out a performance tuning using such a performance tuning method, and a computer-readable storage medium which stores such a computer-readable program.
2. Description of the Related Art
Generally, in a cross-development environment, the program is tuned by acquiring information related to the running performance via a simulator, emulator and the like. The methods of measuring the running performances of the programs differ in most cases depending on the running environments of the programs.
For example, the entire program is measured by the emulator, which is a sampler, and a target portion that is to be tuned is narrowed down from the occupied ratio and the number of references made for each function. In addition, more detailed information related to the running performance of the narrowed down target portion is acquired by a performance analyzer (PA) which is an emulator that displays the model operation state, a high-precision profiler which is a simulator, and the like, which are other than the sampler, so as to narrow down the tuning point. Accordingly, it is possible to effectively and efficiently tune the performance of the program.
The running environment of the sampler, the running environment of the performance analyzer and the running environment of the profiler exist independently of each other. For this reason, the running and control of the target program that is to be measured must be set with respect to each project.
FIG. 1 is a flow chart for explaining an example of a conventional performance tuning method. It is assumed for the sake of convenience that, as the measuring environment, the method of measuring the running performance of the program can select different samplers, profilers and performance analyzer depending on the running environment. The sampler, the profiler and the performance analyzer are tools for measuring the running performance of the program.
In FIG. 1, a step S1 selects a measuring environment for the running performance of the program. The process advances to a step S2-1 if the selected measuring environment is the sampler, advances to a step S2-2 if the selected measuring environment is the profiler, and advances to a step S2-3 if the selected measuring environment is the performance analyzer. Since the steps S2-2 through S7-2 and the steps S2-3 through S7-3 basically carry out processes similar to those of the steps S2-1 through S7-1, a description will be given of a case where the measuring environment that is selected first is the sampler and the measuring environment that is selected next is the performance analyzer.
The step S2-1 creates a project for measuring the running performance of the program, by the sampler. The step S3-1 is carried out if a measuring range (that is, the measuring environment) of the sampler is set in a source-embedded form, and sets the measuring range. The step S4-1 builds and loads the measuring target. The step S5-1 is carried out if the step S3-1 is not carried out, and sets the measuring range (that is, the measuring environment) of the sampler. The step S6-1 carries out a measurement by the sampler using the set measuring range. The step S7-1 acquires performance information of the program obtained as a result of the measurement, and the process advances to a step S8.
The step S8 decides whether or not the acquired performance information indicates a desired performance or higher and is sufficiently high. If the decision result in the step S8 is YES, a step S9 decides whether or not to tune the performance of the program. If the decision result in the step S9 is YES, a step S10 tunes the program based on an instruction from an operator (or user). If the decision result in the step S8 is NO or, after the step S10, a step S11 decides whether or not to measure the running performance of the program under another measuring condition, and the process returns to the step S1 if the decision result in the step S11 is YES. If the decision result in the step S9 or S11 is NO, the process ends.
FIGS. 2 through 5 are diagrams showing examples of display screens that are displayed on a display part of a computer system when executing steps S2-1, S3-1, S5-1 and S7-1.
In FIG. 2, “+Sampler.PRJ” indicates the project that is created in the step S2-1, and it is assumed that this project is registered in an integrated development environment (IDE). In addition, “−start_sampler.s” and “−sampler.lib” respectively indicate a measuring source and a library that are used by the measurement made by the sampler. Moreover, “−test1.c”, “−test2.c” and “−test3.c” indicate user applications. In the integrated development environment, the sampler or performance analyzer or profiler is selected by a project control in the case described above, and the compiling, assembling and linking are carried out by a build control. Further, the running performance of the target program is measured and performance information of the target program is acquired by an emulator control, when the performance analyzer or profiler is selected. The running performance of the target program is measured and the performance information of the target program is acquired by the emulator control, when the profiler is selected.
In FIG. 3, a portion surrounded by bold lines indicate the measuring range of the sampler that is set in the source-embedded form in the step S3-1.
In FIG. 4, a portion surrounded by bold lines indicate the measuring range of the sampler that is set in a form other than the source-embedded form in the step S5-1. Particularly in the case of the profiler or the like, it may not be necessary to make a source-embedding such as “−start_sampler( )” by use of a tool. In such a case, a break may be made at a position indicated by “O” in FIG. 4, for example, and the sampler may be turned ON so as to measure the running performance of the program, and a break may be made at a next position indicated by “O”, so as to set a part between the two breaks “O” as the measuring range in which the measurement is possible.
In the particular case shown in FIG. 5, the performance information of the program acquired in the step S7-1 includes a number of calls (or call number) and the occupied ratio with respect to each function name. From the performance information of the program shown FIG. 5, it is possible to specify a high-cost function, and the running performance of the program is measured under another measuring environment with respect to a high-cost function “func11( )”, for example. It is assumed for the sake of convenience that the performance analyzer is selected as the measuring environment in the step S1 with respect to the high-cost function “func11( )”.
FIGS. 6 through 10 are diagrams showing examples of display screens that are displayed on the display part of the computer system when executing the steps S2-3, S3-3, S5-3 and S7-3.
In FIG. 6, “+PA.PRJ” indicates a project that is created in the step S2-3, and “−start_pa.s” indicates a measuring source that is used for the measurement by the performance analyzer. In addition, “−test1.c”, “−test2.c” and “test3.c” indicate user applications.
In FIG. 7, since the portion surrounded by the bold lines indicates the measuring range of the sampler that is set in the source-embedded form in the step S3-1, the step S3-3 first deletes this range. In FIG. 8, a portion surrounded by bold lines indicates a measuring range of the performance analyzer that is set in the source-embedded form in the step S3-3. In this particular case, an exclusive function is embedded in order to carry out the measurement by the performance analyzer with respect to the high-cost function “func11( )”.
In FIG. 9, a portion surrounded by bold lines indicate a measuring range of the performance analyzer that is set in a form other than the source-embedded form in the step S5-3.
In the particular case shown in FIG. 10, the performance information of the program acquired in the step S7-3 is made up of performance indexes including instruction level parallelism (ILP), I$-Miss, D$-Miss and stall. Accordingly, it is possible to specify the performance indexes of the high-cost function “func11( )”.
Therefore, according to the conventional performance tuning method, the operator must carry out a troublesome operation of setting the measuring range every time the running performance of the program is to be measured, such as when using a different measuring environment (that is, a different measuring method) and when carrying out the measurement that narrows down the measuring range.
In addition, although it is conceivable to use the setting information that has been set when the measurement was made by the sampler, for example, as the setting information for the measurement by the performance analyzer, there are cases where the measurement result by the sampler which makes the measurement first must be definite before the measuring range of the performance analyzer which makes the measurement next may be specified. Hence, the setting information that has been set for the measurement cannot be used as it is for the measurement using a different measuring method or a different measuring environment.
Therefore, there was a problem in that it is difficult to efficiently tune the performance of the program by the conventional performance tuning method.